home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10505 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: mudskipper.cac.psu.edu!user
  2. From: fcusack@tdx.org (frank.)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Why doesn't this compile?
  5. Date: Mon, 18 Mar 1996 06:06:51 -0400
  6. Organization: Soylent Green is People!!
  7. Message-ID: <fcusack-1803960606510001@mudskipper.cac.psu.edu>
  8. References: <4igck9$idj@masala.cc.uh.edu>
  9. NNTP-Posting-Host: mudskipper.cac.psu.edu
  10.  
  11. In article <4igck9$idj@masala.cc.uh.edu>, BSamuel@uh.edu (Binoy K. Samuel)
  12. wrote:
  13.  
  14. > Hi:
  15. > I am taking a C class this semester.
  16. > And I have just written a program that runs (more or less) quite well.
  17. > However, when I try to compile it, I get the following error:
  18. >         
  19. >         "Call to function 'evalchar' with no prototype"
  20. > Why does this happen? 'Evalchar' is a function that I wrote.  What 
  21. > prototype should I be looking for.
  22. > Here's the function header line:
  23. >         char evalchar(cnum)
  24. >         int cnum;
  25. Are they actually teaching you this? This is not ANSI C, and you should
  26. complain vehemently. Should be
  27.  
  28.       char evalchar(char);
  29.  
  30. (note I made the int a char, since that what the function is doing...)
  31.  
  32. You must make sure that the compiler sees the prototype before the
  33. function is used. (either in a header file, or at the very top of your
  34. program).
  35.  
  36. ~Frank
  37.  - Through the modem, past the router, over the firewall.. nothing but Net -
  38.  -  PGP ID: 1C0F6685 | NCB#56 | Visit me --> http://www.tdx.org/~fcusack/  -
  39.